Twinkles First Light

LSST DESC Hack Day, February 6th, 2015 at SLAC

Goal: get on the sky.


In [6]:
# Import utilities
import lsst.afw.image as afwImage
import numpy
from matplotlib import pylab as plt
%matplotlib inline

# Download images from Simon:
!curl -k -O http://www.astro.washington.edu/users/krughoff/data/twinkles_firstlight_interesting.fits
!curl -k -O http://www.astro.washington.edu/users/krughoff/data/twinkles_firstlight_boring.fits

# Read in two images from PhoSim run, one with lenses, one without:
interesting = afwImage.ImageF('twinkles_firstlight_interesting.fits')
boring = afwImage.ImageF('twinkles_firstlight_boring.fits')


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 62.1M  100 62.1M    0     0  5183k      0  0:00:12  0:00:12 --:--:-- 5417k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 62.1M  100 62.1M    0     0  6336k      0  0:00:10  0:00:10 --:--:-- 7412k

In [13]:
# Adjust settings for image display:
settings = dict(cmap='cubehelix', interpolation='nearest', origin='lower', vmin=-5, vmax=50)

interestingArr = interesting.getArray()
boringArr = boring.getArray()

# Subtract median first so the interesting and difference image can be plotted
# with the same scale.
interestingArr -= numpy.median(interestingArr)
boringArr -= numpy.median(boringArr)

# Difference the images:
diff = interesting.getArray() - boring.getArray()

# Plot!
fig = plt.figure(figsize=(24.,18.))

ax1 = fig.add_subplot(2,1,1)
cax1 = ax1.imshow(diff, **settings)
cbar1 = fig.colorbar(cax1)
_ = ax1.set_title("Difference from Boring Data Image")

ax2 = fig.add_subplot(2,2,1)
cax2 = ax2.imshow(interesting.getArray(), **settings)
cbar2 = fig.colorbar(cax2)
_ = ax2.set_title("Interesting Data Image")



In [ ]: